Update examples and plotters for bumps webview #676
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Redo the plotting routines using a more compact layout, better suited for use with bumps webview.
This code is not used by SasView
Notes:
(1) Include both matplotlib and plotly backends.
The plotly backend isn't enabled because the bumps interface to plotly in model is not yet stable. See bumps/bumps#342
(2) plotly heatmaps do not yet display correctly in bumps
To see the plots in matplotlib and plotly type the following to load and display the plots without bumps:
python example/fit2d.pyNow switch to the fix-improve-mpl-support branch in bumps, uncomment
def plotly(...)inbumps_model.Experiment.plot, then runbumps example/fit2d.pyThe plotly 2d plots are still ugly. Figure out how to shrink the graph area to just the data
(3) The limits parameter for plot_theory doesn't work for q^4 plots
(4) matplotlib log data error plots do not work with webview
This is an issue with the mpld3 library used to render them: mpld3/mpld3#488
(5) Should be sharing the 2D rebinning code with sasview
(6) The algorithm for select Δqx and Δqy when converting from a bag of (qx, qy, I(qx, qy)) values to a 2D image should be improved. Pixels should be roughly square; instead of assuming a square aspect ratio it should use the qx and qy extent ratio. The algorithm is assuming that (qx, qy) is relatively uniform throughout bounding box so it is creating a grid with approximately one measurement per pixel. This fails if the dataset has significant masking, or if it combines measurements with significant overlap. Either find a better algorithm as part of this PR or create a separate ticket asking to improve it.
(7) Although these changes mirror some of those in the sasview plotting refactor (SasView/sasview#2940 and SasView/sasview#3111) it doesn't look like higher level code sharing will be possible.